import { Module } from '@nestjs/common';
import { AdminController } from './controllers';
import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';
import { AdminService, AdminAuthService, AdminUsersService } from './services';
import { AdminLocalStrategy, AdminJwtStrategy } from './strategies';
import { JwtModule } from '@nestjs/jwt';
import { jwtConstants } from './constants';
import { PassportModule } from '@nestjs/passport';
@Module({
  imports: [
    ServeStaticModule.forRoot({
      rootPath: join(__dirname, '.', 'client'),
      serveRoot: '/admin',
      renderPath: '/admin',
    }),
    PassportModule,
    JwtModule.register({
      secret: jwtConstants.secret,
      signOptions: { expiresIn: '30d' },
    }),
  ],
  controllers: [AdminController],
  providers: [
    AdminService,
    AdminAuthService,
    AdminUsersService,
    AdminLocalStrategy,
    AdminJwtStrategy,
  ],
})
export class AdminModule {}
